<%
/**
 *  @author
 *  Date : 2012-10-10
 *  Description : Payment receipt for customer
 */

    final String pageTitle = "Payment Receipt";
    final String pageTitleEN = "PAYMENT HISTORY";
    final String pageTitleBM = "";
%>

<%@ page import="com.checkfree.isolutions.customer.persist.*" %>
<%@ page import="com.checkfree.isolutions.statement.*" %>
<%@ page import="com.checkfree.isolutions.statement.persist.*" %>
<%@ page import="com.myebills.ebpsfrontend.controller.*" %>
<%@ page import="com.checkfree.isolutions.property.Properties" %>
<%@ page import="com.checkfree.isolutions.property.PropertiesConfig" %>
<%@ page import="java.util.*" %>
<%@ page import="java.net.*" %>
<%@ page import="java.text.*" %>
<%@ page import="com.myebills.ebpsfrontend.maxis.*" %>

<%
	String merchantID = EbppxUtil.nullToEmpty(request.getParameter("merchantID"));
	String merchTxnRef = EbppxUtil.nullToEmpty(request.getParameter("merchTxnRef"));
	String orderID = EbppxUtil.nullToEmpty(request.getParameter("orderID"));
	String orderInfo = EbppxUtil.nullToEmpty(request.getParameter("orderInfo"));
	String systemID = EbppxUtil.nullToEmpty(request.getParameter("systemID"));
	String amount = EbppxUtil.nullToEmpty(request.getParameter("amount"));
	String billPaymentMSISDN = EbppxUtil.nullToEmpty(request.getParameter("billpaymentMSISDN_or_AccNo"));
	String paymentType = EbppxUtil.nullToEmpty(request.getParameter("paymentType"));
	String nrcID = EbppxUtil.nullToEmpty(request.getParameter("nrcID"));
	String hash = EbppxUtil.nullToEmpty(request.getParameter("hash"));
	String deviceFingerprint = EbppxUtil.nullToEmpty(request.getParameter("deviceFingerprint"));
	String productIdentifierCode = EbppxUtil.nullToEmpty(request.getParameter("productIdentifierCode"));
	String productName = EbppxUtil.nullToEmpty(request.getParameter("productName"));
	String productQuantity = EbppxUtil.nullToEmpty(request.getParameter("productQuantity"));
	String customerEmail = EbppxUtil.nullToEmpty(request.getParameter("customerEmail"));
	String IPaddress = EbppxUtil.nullToEmpty(request.getParameter("IPaddress"));
	String timestamp = EbppxUtil.nullToEmpty(request.getParameter("timestamp"));
	String message = EbppxUtil.nullToEmpty(request.getParameter("Message"));
	String receiptNo = EbppxUtil.nullToEmpty(request.getParameter("receiptNo"));
	if(receiptNo==null || receiptNo.equals("")){
		receiptNo = "N/A";
	}
	String txnResponseCode = EbppxUtil.nullToEmpty(request.getParameter("txnResponseCode"));
	String txnNo = EbppxUtil.nullToEmpty(request.getParameter("txnNo"));

	amount = EbppxUtil.appendCharAt(amount,'.',2,"-");

%>
<html>

<head>
	<meta charset="utf-8" />

  	<!-- Set the viewport width to device width for mobile -->
  	<meta name="viewport" content="width=device-width" />

  	<title>Maxis IPC</title>

 	<!-- Included CSS Files (Compressed) -->
   	<link rel="stylesheet" href="stylesheets/foundation.css">
   	<link rel="stylesheet" href="stylesheets/app.css">
    <link rel="stylesheet" href="stylesheets/style.css">
	<script src="javascripts/modernizr.foundation.js"></script>
	<script language="javascript">
	function CloseWindow(){
		window.open('', '_self', '');
		window.close();
	}
</script>

</head>
<body>

<!--- START-FOR -------------------------------------------------------------------------------------------------------------->

  	<div class="row">
    	<div class="twelve columns" style="border:solid 0px; width:980px;">
            <div class="six columns" style=" border-bottom:solid 5px #52ae32; height:86px;">
            </div>
            <div class="six columns" style=" border-bottom:solid 5px #007c47; height:86px; text-align:right;">
            	<img src="images/logo.jpg" alt="" border="0" style="padding-top:8px; padding-bottom:6px; margin-right:-20px; border: solid 0px;">
				<div style=" margin:-2px -12px 0 0; font-size:12px;">Have a question? Our <a target="_blank" href="https://pay.maxis.com.my/IPCAgree/FAQ.html">FAQs</a> have your answer.</div>
            </div>
      	</div>
	</div>

    <div class="row">
    	<div class="twelve columns" style="border:solid 0px; width:980px;">

            <!---START---inner columns-------------------------------------------------------------------------------------------------------------->
            <div style="min-height:500px;">
            	<div class="twelve columns">
                    <div style="font-size:18px; color:#007944; font-weight:bold; padding:12px 0 5px 0; margin: 0 0 0 -16px;">
                            Payment Done
                    </div>
<%
				if(txnResponseCode!=null && txnResponseCode.equals("0")){
%>
                    <div>
                        <div style="font-size:16px; padding-bottom:5px; padding-top:10px; text-align:left;">
                           	<p>
                                Thank you! Your payment of <%=amount%> to Maxis Collections Sdn. Bhd. is <b><font color="green">SUCCESSFUL</font></b>. Following is the receipt for your payment. Don't worry, we have sent the details to your email as well!
                            </p>
                        </div>
                    </div>
<%
				}else{
%>
                    <div>
                        <div style="font-size:16px; padding-bottom:5px; padding-top:10px; text-align:left;">
                           	<p>
                                Sorry! Your payment of <%=amount%> to Maxis Collections Sdn. Bhd. <b><font color="red">FAILED</font></b>. Please try again or call our customer service at 1800 821 123 for assistance.
                            </p>
                        </div>
                    </div>
<%
				}
%>
                    <div class="mTwelveDiv">
                        <div style="font-size:14px; padding-bottom:10px; padding-top:5px; text-align:left;">
                           	<p>
                            	<b>Payment Status</b>
                                <br><%=message%>
                            </p>
                           	<p>
                            	<b>Account No</b>
                                <br><%=billPaymentMSISDN%>
                            </p>
                           	<p>
                            	<b>RECEIPT NUMBER</b>
                                <br><%=receiptNo%>
                            </p>
                           	<p>
                            	<b>Payment Amount</b>
                                <br>RM<%=amount%>
                            </p>
                        </div>
                    </div>
                    <div style="float:left; height:38px; border:solid 0px; width:940px;">
                        <div style="margin:10px 0px 0 550px; float:right; border: solid 0px;">
                        	<div></div>
                            <a href="#" onclick="CloseWindow()"><div class="button" style="width:180px;" onclick="javascript:window.close();">RETURN TO MERCHANT</div></a>
                        </div>
                    </div>
                </div>
            </div>
            <!---END--- inner columns-------------------------------------------------------------------------------------------------------------->



      	</div>
	</div>



	<div class="row" style="width:990px; padding-left:40px;">
    	<div class="twelve columns  footer">
        	Copyright © 2012 Maxis Bhd [867573-A]. All rights reserved.
        </div>
    </div>


<!--- END-FOR -------------------------------------------------------------------------------------------------------------->







	<script src="javascripts/jquery.js"></script>
    <script src="javascripts/jquery.foundation.tooltips.js"></script>
    <script src="javascripts/jquery.foundation.forms.js"></script>
    <script src="javascripts/jquery.foundation.orbit.js"></script>


    <script>
		//$(document).tooltips();
		$(document).foundationCustomForms();
		$(document).tooltips();
		$(document).bind("dragstart", function() {
			 return false;
		});
		$(window).load(function() {

			$("#submitFormA").click(function(){
				$("form#formA").submit();
			});

			$("#btn-exp").click(function() {
				$(this).toggleClass('active');
				$("#myformdescp").toggle();
				$('#myform').toggle();
			}).mouseover(function(){$(this).css('cursor', 'pointer');});

       		$('#featuredContent').orbit({
				 animation: 'horizontal-push',                  // fade, horizontal-slide, vertical-slide, horizontal-push
				 animationSpeed: 800,                // how fast animtions are
				 timer: true, 					 // true or false to have the timer
				 resetTimerOnClick: false,           // true resets the timer instead of pausing slideshow progress
				 advanceSpeed: 3000, 		 // if timer is enabled, time between transitions
				 pauseOnHover: false, 		 // if you hover pauses the slider
				 startClockOnMouseOut: true, 	 // if clock should start on MouseOut
				 startClockOnMouseOutAfter: 1000, 	 // how long after MouseOut should the timer start again
				 directionalNav: false, 		 // manual advancing directional navs
				 captions: false, 			 // do you want captions?
				 captionAnimation: 'fade', 		 // fade, slideOpen, none
				 captionAnimationSpeed: 800, 	 // if so how quickly should they animate in
				 bullets: true,			 // true or false to activate the bullet navigation
				 bulletThumbs: false,		 // thumbnails for the bullets
				 bulletThumbLocation: '',		 // location from this file where thumbs will be
				 afterSlideChange: function(){}, 	 // empty function
				 fluid: '14x7'                         // or set a aspect ratio for content slides (ex: '4x3')
 			});
   		});
	</script>


</body>
</html>
